package com.qidian.mes.sso.controller;

import com.qidian.common.pojo.MESResult;
import com.qidian.mes.pojo.User;
import com.qidian.mes.sso.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 任超
 * Time 2024/10/14 9:51
 */
@RestController
@CrossOrigin
@RequestMapping("/auth")
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/login")
    public MESResult login(@RequestBody User user){
        return userService.login(user.getUsername(),user.getUserPass());
    };

    @RequestMapping("/check")
    public MESResult check(String token){
        return userService.checkLogin(token);
    };
}
